<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.8"/>
<title>embedme: JSONData类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">embedme
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.8 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li class="current"><a href="annotated.html"><span>类</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>类列表</span></a></li>
      <li><a href="classes.html"><span>类索引</span></a></li>
      <li><a href="hierarchy.html"><span>类继承关系</span></a></li>
      <li><a href="functions.html"><span>类成员</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="class_j_s_o_n_data-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">JSONData类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p>JSON数据类.  
 <a href="class_j_s_o_n_data.html#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_j_s_o_n_data_8h_source.html">JSONData.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a9f46424eb4d3c4826c8cb76e84bfee5d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_s_o_n_data.html#a9f46424eb4d3c4826c8cb76e84bfee5d">JSONData</a> ()</td></tr>
<tr class="memdesc:a9f46424eb4d3c4826c8cb76e84bfee5d"><td class="mdescLeft">&#160;</td><td class="mdescRight">JSONData构造函数  <a href="#a9f46424eb4d3c4826c8cb76e84bfee5d">更多...</a><br /></td></tr>
<tr class="separator:a9f46424eb4d3c4826c8cb76e84bfee5d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a871e3e2607e7fe0cc01d6db7eaa9d215"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_j_s_o_n_node.html">JSONNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_s_o_n_data.html#a871e3e2607e7fe0cc01d6db7eaa9d215">initWithObjectFormat</a> ()</td></tr>
<tr class="memdesc:a871e3e2607e7fe0cc01d6db7eaa9d215"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化JSONData为对象形式  <a href="#a871e3e2607e7fe0cc01d6db7eaa9d215">更多...</a><br /></td></tr>
<tr class="separator:a871e3e2607e7fe0cc01d6db7eaa9d215"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae01c9932621412711e4fabb79a4bac2f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_j_s_o_n_node.html">JSONNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_s_o_n_data.html#ae01c9932621412711e4fabb79a4bac2f">initWithArrayFormat</a> ()</td></tr>
<tr class="memdesc:ae01c9932621412711e4fabb79a4bac2f"><td class="mdescLeft">&#160;</td><td class="mdescRight">初始化JSONData为数组形式  <a href="#ae01c9932621412711e4fabb79a4bac2f">更多...</a><br /></td></tr>
<tr class="separator:ae01c9932621412711e4fabb79a4bac2f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a653a8af11dd25bfed0663cf4f04305f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_j_s_o_n_node.html">JSONNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_s_o_n_data.html#a653a8af11dd25bfed0663cf4f04305f8">initWithDataString</a> (const char *jdata)</td></tr>
<tr class="memdesc:a653a8af11dd25bfed0663cf4f04305f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">读取JSON字符串进行初始化  <a href="#a653a8af11dd25bfed0663cf4f04305f8">更多...</a><br /></td></tr>
<tr class="separator:a653a8af11dd25bfed0663cf4f04305f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a967f7a7b32b4383530d5d443d4a15bb7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_j_s_o_n_node.html">JSONNode</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_s_o_n_data.html#a967f7a7b32b4383530d5d443d4a15bb7">initWithContentOfFile</a> (const std::string fileName)</td></tr>
<tr class="memdesc:a967f7a7b32b4383530d5d443d4a15bb7"><td class="mdescLeft">&#160;</td><td class="mdescRight">读取JSON文件内容进行初始化  <a href="#a967f7a7b32b4383530d5d443d4a15bb7">更多...</a><br /></td></tr>
<tr class="separator:a967f7a7b32b4383530d5d443d4a15bb7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f1f54caaa2a8e27bfad7544912ffdda"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_s_o_n_data.html#a9f1f54caaa2a8e27bfad7544912ffdda">saveAsFile</a> (const std::string fileName, bool fmt=false)</td></tr>
<tr class="memdesc:a9f1f54caaa2a8e27bfad7544912ffdda"><td class="mdescLeft">&#160;</td><td class="mdescRight">写入JSON数据到文件中  <a href="#a9f1f54caaa2a8e27bfad7544912ffdda">更多...</a><br /></td></tr>
<tr class="separator:a9f1f54caaa2a8e27bfad7544912ffdda"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab63641ef987c9e3abb417a8e0df54153"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_s_o_n_data.html#ab63641ef987c9e3abb417a8e0df54153">serialize</a> (bool fmt=false)</td></tr>
<tr class="memdesc:ab63641ef987c9e3abb417a8e0df54153"><td class="mdescLeft">&#160;</td><td class="mdescRight">串行化JSONData成字符串  <a href="#ab63641ef987c9e3abb417a8e0df54153">更多...</a><br /></td></tr>
<tr class="separator:ab63641ef987c9e3abb417a8e0df54153"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>JSON数据类. </p>
</div><h2 class="groupheader">构造及析构函数说明</h2>
<a class="anchor" id="a9f46424eb4d3c4826c8cb76e84bfee5d"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">JSONData::JSONData </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>JSONData构造函数 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>none </dd></dl>
<dl class="section note"><dt>注解</dt><dd>JSONData有两种形式,一种是对象形式:形如"{key:value,...}",用大括号 将所有子结点包围.另一种是更简化的数组形式:形如"[{...},{...}]",用 中括号[]将同一类型的子结点包围,数组中可以包含同一类型的对象. JSONData的根结点就是它本身,其他的都视为子结点。 </dd></dl>

</div>
</div>
<h2 class="groupheader">成员函数说明</h2>
<a class="anchor" id="ae01c9932621412711e4fabb79a4bac2f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_s_o_n_node.html">JSONNode</a> * JSONData::initWithArrayFormat </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化JSONData为数组形式 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回根结点,失败返回NULL </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a967f7a7b32b4383530d5d443d4a15bb7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_s_o_n_node.html">JSONNode</a> * JSONData::initWithContentOfFile </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>fileName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>读取JSON文件内容进行初始化 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回根结点,失败返回NULL </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a653a8af11dd25bfed0663cf4f04305f8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_s_o_n_node.html">JSONNode</a> * JSONData::initWithDataString </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>jdata</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>读取JSON字符串进行初始化 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回根结点,失败返回NULL </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a871e3e2607e7fe0cc01d6db7eaa9d215"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_s_o_n_node.html">JSONNode</a> * JSONData::initWithObjectFormat </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>初始化JSONData为对象形式 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回根结点,失败返回NULL </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="a9f1f54caaa2a8e27bfad7544912ffdda"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool JSONData::saveAsFile </td>
          <td>(</td>
          <td class="paramtype">const std::string&#160;</td>
          <td class="paramname"><em>fileName</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>fmt</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>写入JSON数据到文件中 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回true,失败返回false </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<a class="anchor" id="ab63641ef987c9e3abb417a8e0df54153"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string JSONData::serialize </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>fmt</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>串行化JSONData成字符串 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">none</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>成功返回STATUS_OK,失败返回STATUS_ERROR </dd></dl>
<dl class="section note"><dt>注解</dt><dd>none </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>libemb/inc/<a class="el" href="_j_s_o_n_data_8h_source.html">JSONData.h</a></li>
<li>libemb/src/JSONData.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2016年 七月 7日 星期四 19:49:38 , 为 embedme使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.8
</small></address>
</body>
</html>
